package com.xk857.school.controller;


import com.xk857.school.req.TourismApplyREQ;
import com.xk857.school.service.ITourismUserService;
import com.xk857.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户旅游中间表 前端控制器
 * </p>
 *
 * @author CV大魔王
 * @since 2021-05-03
 */
@Api(value = "组团报名管理接口", tags = "组团报名管理接口")
@RestController
@RequestMapping("/pri/tourism/user")
public class TourismUserController {

    @Autowired
    private ITourismUserService tourismUserService;

    @ApiOperation("用户报名")
    @PostMapping("/apply")
    public Result apply(@RequestBody TourismApplyREQ req){
        return tourismUserService.apply(req);
    }


    @ApiOperation("取消报名")
    @DeleteMapping("/{couriterId}")
    public Result cancelRegistration(
            @ApiParam(value="传入旅游表id",required=true) @PathVariable String couriterId) {
        return tourismUserService.cancelRegistration(couriterId);
    }
}
